//
//  UILabel+Extension.swift
//  SinaWeibo
//
//  Created by Apple on 15/11/14.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title: String, size: CGFloat, color:UIColor, margin: CGFloat = 0) {
        self.init()
        text = title
        textAlignment = .Center
        font = UIFont.systemFontOfSize(size)
        numberOfLines = 0
        textColor = color
        if margin != 0 {
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
            
        }
        sizeToFit()
    }
}
